reading from a file using fread function